package com.plian.system.wrapper.qg.evaluate;

import com.plian.system.dto.qg.evaluate.EvaluateReformDTO;
import com.plian.system.entity.qg.evaluate.EvaluateReform;
import com.plian.system.mybatis.support.BaseWrapper;
import com.plian.system.vo.qg.evaluate.EvaluateReformVO;
import com.plian.system.wrapper.util.CacheWrapperUtil;
import com.plian.system.wrapper.util.WrapperUtil;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;

import static com.plian.system.wrapper.util.WrapperConstant.*;

/**
 * @author lwb
 * @create 2023-02-20
 * @description
 */
@Mapper(componentModel = SPRING, uses = {CacheWrapperUtil.class, WrapperUtil.class})
public interface EvaluateReformWrapper extends BaseWrapper<EvaluateReform, EvaluateReformDTO, EvaluateReformVO> {
    @Override
    @Mappings(value = {
            @Mapping(source = "createUser", target = "createUserName", qualifiedByName = USER_ID_TO_NAME),
            @Mapping(source = "updateUser", target = "updateUserName", qualifiedByName = USER_ID_TO_NAME),
            @Mapping(source = "reportPerson", target = "reportPersonName", qualifiedByName = USER_ID_TO_NAME),
            @Mapping(source = "enterpriseNameId", target = "enterpriseNameId", qualifiedByName = ORG_ID_TO_NAME)
    })
    EvaluateReformVO entityToVO(EvaluateReform entity);
}
